<template>
  <DetailPage v-bind="detailConfig" :key="key" :model="baseDetailData"></DetailPage>
</template>

<script setup lang="ts">
import DetailPage from '@/views/aplid/DetailPage/index.vue'
import { detailConfig } from '../../../config'
import { getAreaObj } from '@/utils/util'
import apiMod from '@/apiMod'

type Props = {
	nowRowData?: any,
	chainViewInfo?:any,
	isBlockchain?:boolean
}
const props = withDefaults(defineProps<Props>(), {
	nowRowData: {},
	chainViewInfo:{},
	isBlockchain:false
})

let key = ref('1')

// let operateStatusList = reactive([])

// getDict()

// 获取营业状态字典数据

// 获取初始化数据
let baseDetailData = reactive({})
const getInitData = () => {
	apiMod.dpServiceFacility_info(props.nowRowData.id).then((res) => {
		res.data.areas_name = getAreaObj(res.data, '')
		res.data.areas = [res.data.provinceId, res.data.cityId, res.data.areaId, res.data.streetId, res.data.communityId]
		baseDetailData = res.data
		key.value = '2'
	})
}

onBeforeMount(() => {
	if(props.isBlockchain){
		baseDetailData = props.chainViewInfo
	}else{
		getInitData()
	}
})
</script>

<style scoped>
.bottom {
	margin-top: 13px;
	line-height: 12px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.detail-label {
	color: #eee;
}

.image {
	width: 90%;
	height: 220px;
	display: block;
}
</style>
